<!DOCTYPE html>
<html>

<head>
    <title>对外发布信息平台</title>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="author" content="Beijing Normal University" />
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/flexslider.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link href="css/cjc.css" rel="stylesheet" type="text/css">
    <link href="css/index.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="jquery/1.9.1/jquery.js"></script>
    <script src="jquery/1.9.1/jquery.min.js"></script>
    <!--  <script src="js/layer.js"></script> -->
    <style type="text/css">
    .redlf {
        font-weight: bold;
        color: #F00;
    }
    
    .boldlf {
        font-weight: bold;
    }
    </style>
</head>

<body>
    <!-- Static navbar -->
    <!-- <hr style="height:10px;border:none;border-top:10px groove skyblue;" /> -->
    <!--   <div class="navbar navbar-up navbar-static-top">

    </div> -->
    <div class="main mainbg">
        <div class="container bg-white">
            <div class="slider-hover col-md-12">
                <img src="image/login_top_left.png" class="img-responsive" width="100%" />
                <img src="image/toptitle.png" class="img-responsive" width="100%" />
            </div>
            <!-- <div  >
            </div> -->
            <div class="mainslide row">
            </div>
            <hr style="height:10px;border:none;border-top:10px groove skyblue;" />
            <!-- 中间的box -->
            <div class="maincontent row">
                <!-- 左边列 -->
                <div class="col-md-6 col-sm-8 firstlist">
                    <div class="boxtitle" style="height:50%">
                        <span id="news" class="title" value="新闻速递">新闻速递</span>
                        <!-- <a class="more" href="bsdkx/index.html">更多</a> -->
                    </div>
                    <div class="boxlist">
                        <ul id="news_noticeTitle" class="">
                        </ul>
                    </div>
                    <div class="boxtitle nomargintop">
                        <span id="landchange" class="title">土地动态</span>
                    </div>
                    <div class="boxlist">
                        <ul id="landchange_noticeTitle" class="">
                        </ul>
                    </div>
                </div>
                <!-- 中间列 -->
                <div class="col-md-4 col-sm-4 midlist">
                    <div class="boxtitle">
                        <span id="notice" class="title">通知公告</span>
                    </div>
                    <div class="boxlist">
                        <ul id="notice_noticeTitle" class="">
                        </ul>
                    </div>
                    <div class="boxtitle nomargintop">
                        <span id="landlaw" class="title">土地政策</span>
                    </div>
                    <div class="boxlist">
                        <ul id="landlaw_noticeTitle" class="">
                        </ul>
                    </div>
                </div>
                <!-- 最右列 -->
                <div class="col-md-2 bg-blue col-sm-12">
                    <div class="sidebar">
                         <div class="sidebar">
                    <div class="col-md-12 col-sm-4 nopadding">
                        <span class="morelinks">快速登录</span>
                        <span>
                            <a href="http://localhost:8080/landuse/login.jsp;jsessionid=044B503019BFB72A28FD9FE342662864" target="_blank">数据管理用户登录</a> </span>
                        <span><a href="http://localhost:8080/landuse/login.jsp;jsessionid=044B503019BFB72A28FD9FE342662864" target="_blank" target="_blank">企业用户登录</a></span>
                        <hr style="height:10px;border:none;border-top:10px groove skyblue;" />
                    </div>
                        <div class="col-md-12 col-sm-4 nopadding">
                            <span class="morelinks">常用链接</span>
                            <span>　<a href="http://www.hljlr.gov.cn/hljgtzyt/zwgk/tzgg/201510/t20151016_119652.htm" target="_blank">黑龙江省国土资源厅</a>
                        </span>
                        <span>
                        <a href="http://old.mlr.gov.cn/" target="_blank">中华人民共和国国土资源部</a></span>
                            <span><a href="http://xqb.bnu.edu.cn/xiaoguo.html" target="_blank">新校区建设指挥部</a></span>
                            <span>
								<a href="http://xyh.bnu.edu.cn/bnuxy/" target="_blank">校友总会</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="http://xuefeng.bnu.edu.cn/" target="_blank">学风建设</a>
							</span>
                            <span><a href="http://www.bnu.edu.cn/jsjyjykx/52918.html">教师教育机构</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="http://www.bnu.edu.cn/jsjyjykx/52919.html">教育科学期刊</a></span>
                            <span>&nbsp;<a href="http://xinqing100.bnu.edu.cn/" target="_blank">京师心晴</a></span>
                            <span><a href="http://ipv6te.bnu.edu.cn/" target="_blank">IPv6教师教育创新支持系统</a></span>
                        </div>
                        <div style="clear:both"></div>
                    </div>
                </div>
            </div>
            <hr style="height:10px;border:none;border-top:10px groove skyblue;" />
            <div>
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tbody>
                        <tr>
                            <td width="22%" height="89" valign="top">
                                <!--  <h3>首页</h3> -->
                                <ul id="lawtypes" class="ul_daohang6">
                                    <!-- <li><a href="ysglk1/index.html">矿产资源管理</a></li>
                                    <li><a href="glkjk1/index.html">土地管理</a></li>
                                    <li><a href="zxzjk1/index.html">海洋管理</a></li>
                                    <li><a href="xssw1/index.html">地方法规</a></li>
                                    <li><a href="gzsw3/index.html">综合管理</a></li>
                                    <li><a href="fpkjygl2/index.html">地质环境管理</a></li>
                                    <li><a href="zfcgk1/index.html">测绘管理</a></li>
                                    <li><a href="hszx1/index.html">相关法律</a></li>
                                    <li><a href="hszx1/index.html">法律解释</a></li>
                                    <li><a href="hszx1/index.html">部门规章</a></li> -->
                                </ul>
                            </td>
                            <td width="78%" rowspan="2" valign="top">
                                <table width="100%" border="0" align="right" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                                    <tbody>
                                        <tr id="lawtr">
                                            <td class='boxtitle' align='left' width='50%' height='31'><span class="title">信息标题</span></td>
                                            <td class='boxtitle' align='middle' width='20%' height='31'><span class="title">阅读量</span></td>
                                            <td class='boxtitle' align='middle' width='30%' height='31'><span class="title">发布时间</span></td>
                                        </tr>
                                    </tbody>
                                    <tbody id="law_table">
                                    </tbody>
                                    <!--  <tbody id="page">
                                    	
                                    </tbody> -->
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <hr style="height:10px;border:none;border-top:10px groove skyblue;" />
            <div class="footercontant  row">
                <div class="footercontantline col-md-12">
                    <span class="col-md-10">&copy; Copyright 北京世级九州软件有限公司　地址：北京市海淀区永庄北路9号7号院206 　</span>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript">
$.ajax({
    url: "http://localhost:8080/landuse/get_LawTypes?_dc=1465535514109&page=1&start=0&limit=25",
    success: function(result) {
        var lawtypes = result.root;

        for (var i = 0; i < lawtypes.length; i++) {
            var lawclass = lawtypes[i].lawType;
            var lawid = lawtypes[i].id;
            var lawtype = "<li><a  id='lawid" + lawtypes[i].id + "'>" + lawtypes[i].lawType + "</a></li>";
            $("#lawtypes").append(lawtype);
            /*$("#lawid"+lawid).bind("click",function(){
            	console.log(lawclass);
            	console.log(lawid);
            })*/

        };
        $("ul li").click(function() {
            $("#law_table tr").remove();
            //console.log(this.innerText);
            law_list(this.innerText);
        });

        /* $(ul li).click(law_list(this.innerHTML));*/
    }

});
$.ajax({


    url: "http://localhost:8080/landuse/get_NoticeNews?_dc=1465456417022&searchKeyword=&noticeState=&page=1&start=0&limit=25",

    success: function(result) {



        var data = result.root;
        var i = 0;
        for (i; i < data.length; i++) {
            if (data[i].publishDate == null) {
                data[i].publishDate = "未发布";
            }
            console.log("新闻：" + data[i].publishDate);
            console.log(data[i].noticeTitle);
            console.log(data[i].noticeColumn);
            getNotice(data[i], "新闻速递", "news_noticeTitle");
            getNotice(data[i], "通知公告", "notice_noticeTitle");
            getNotice(data[i], "土地动态", "landchange_noticeTitle");
            getNotice(data[i], "土地政策", "landlaw_noticeTitle");

        };

    }

});

function law_list(lawtype) {

    $.ajax({

        url: "http://localhost:8080/landuse/get_Top10Laws?lawType=" + lawtype + "&page=1&start=0&limit=25",

        success: function(result) {

            var lawData = result.root;
            var j = 0,
                record = 0;
            for (j; j < lawData.length; j++) {
                if (lawData[j].publishDate == null) {
                    lawData[j].publishDate = "未发布";
                }


                var law_title = "<tr><td width='50%' height='31' class='aa'><div align='left'><a title='" + lawData[j].lawTitle + "'href='info_detail.html?law_id=" + lawData[j].id + "' target='_blank' class='aa'>" + lawData[j].lawTitle + "</a></div></td><td class='aa' align='middle' width='20%'>【阅读" +lawData[j].readCount+"次】</td><td class='aa' align='middle' width='30%' height='31'>"+ lawData[j].publishDate + "</td></tr>";
                $("#law_table").append(law_title);
                record++;

            }
            $("#law_table").append("<tr><td width='50%' height='31' class='aa'><div align='left'><a  target='_blank' class='aa'></a></td><td class='aa' align='middle' width='20%'></td><td width='30%' class='aa1'><div align='middle' class='footercontantline col-md-12'>总记录数:" + record + "条</div></td></tr>");

        }
    });

};

function getNotice(dataMsg, titles, addMsg) {
    if (dataMsg.noticeColumn == titles) {
        console.log(titles + "绑定ID：" + dataMsg.id.toString());
        var Msg_title = "<li><a class='aa' href='info_detail.html?notice_id=" + dataMsg.id + "'><span >" + dataMsg.noticeTitle + "</span><span align='right'>【阅读"+dataMsg.readCount+"次】【发布时间：" + dataMsg.publishDate + "】</span></a></li>";
        $("#" + addMsg).append(Msg_title);

    }

};
//显示前10条记录
$.ajax({

            url: "http://localhost:8080/landuse/get_Top10Laws?_dc=1465479261629&lawType=&page=1&start=0&limit=25",

            success: function(result) {

                var lawData = result.root;
                var j = 0;
                for (j; j < lawData.length; j++) {
                    if (lawData[j].publishDate == null) {
                        lawData[j].publishDate = "未发布";
                    }
                    console.log(lawData[j].publishDate);
                    var law_title = "<tr><td width='50%' height='31' class='aa'><div align='left'><a title='" + lawData[j].lawTitle + "'href='info_detail.html?law_id=" + lawData[j].id + "' target='_blank' class='aa'>" + lawData[j].lawTitle + "</a></div></td><td class='aa' align='middle' width='20%'>【阅读" +lawData[j].readCount+"次】</td><td class='aa' align='middle' width='30%' height='31'>"+ lawData[j].publishDate + "</td></tr>";
                    $("#law_table").append(law_title);
                }
                $.ajax({

                    url: "http://localhost:8080/landuse/get_laws?_dc=1465479261629&searchKeyword=&page=1&start=0&limit=25",

                    success: function(returnValue) {
                    	var data=returnValue.root;
                        console.log(data.length);
                        $("#law_table").append("<tr><td width='50%' height='31' class='aa'><div align='left'><a  target='_blank' class='aa'></a></td><td class='aa' align='middle' width='20%'></td><td width='30%' class='aa1'><div align='middle' class='footercontantline col-md-12'>总记录数:" + data.length + "条</div></td></tr>");
                    }

                });
            }
        });
            
</script>

</html>
